package com.maoyu.cloud.login.entity;

import com.maoyu.cloud.mybatis.entity.PtUserEntity;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

public class LoginUserEntity extends User {
    /**
     *用户编码
     */
    private String userUuid;
    /**
     *用户邮箱
     */
    private String email;
    /**
     *手机号码
     */
    private String mobile;
    /**
     *呢称
     */
    private String niceName;
    public LoginUserEntity(String username, String password, PtUserEntity entity,Collection<? extends GrantedAuthority> authorities) {
        super(username, password, authorities);
        this.userUuid = entity.getUserUuid();
        this.niceName = entity.getNiceName();
        this.email = entity.getEmail();
        this.mobile = entity.getMobile();
    }

    public String getUserUuid() {
        return userUuid;
    }

    public void setUserUuid(String userUuid) {
        this.userUuid = userUuid;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getNiceName() {
        return niceName;
    }

    public void setNiceName(String niceName) {
        this.niceName = niceName;
    }

    @Override
    public String toString() {
        return "LoginUserEntity{" +
                "userUuid='" + userUuid + '\'' +
                ", email='" + email + '\'' +
                ", mobile='" + mobile + '\'' +
                ", niceName='" + niceName + '\'' +
                '}';
    }
}

